home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 007 / asm_subr.arc / GMESSOUT < prev    next >
Encoding:
Text File  |  1986-01-20  |  2.1 KB  |  72 lines

  1. ;-------------------------gmessout routine begins--------------------------+
  2. ; NAME  GMESSOUT
  3. ;
  4. ; from BLUEBOOK OF ASSEMBLY ROUTINES FOR IBM PC & XT.
  5. ;         page : 154
  6.  
  7. ; ROUTINE FOR PRINTING A STRING ON THE GRAPHICS SCREEN
  8. ;
  9. ; FUNCTION: This routine prints a messgae on the graphics screen, using
  10. ; the SCHAR or RCHAR routines.  The message terminates in a zero.
  11. ;
  12. ; INPUT: Upon entry:
  13. ;
  14. ;     address of message is in SI
  15. ;    x-coord of upper LH corner is in xmess
  16. ;    y-coord of upper LH corner is in ymess
  17. ;    horiz magnitude of characters is in xmagn
  18. ;    vert magnitude of characters is in xmagn
  19. ;    color of chars is in color
  20. ;    choice of fonts (0=stroke, 1=raster) is in font
  21. ;
  22. ; OUTPUT: Just to the screen
  23. ;
  24. ; REGISTERS USED:  None modified
  25. ;
  26. ; SEGMENTS REFERENCED:  Upon entry ES must point to the video RAM at
  27. ; 0B8000h and DS must point to the data segment used by the point-plot,
  28. ; box-filling, line-drawing and stroke character routines.
  29. ;
  30. ; ROUTINES CALLED:  SCHAR or RCHAR
  31. ;
  32. ; SPECIAL NOTES: No bounds ;hecking is performed.  Unpredictable results
  33. ; will occur if the horizontal or vertical magnitude is too large.
  34. ;
  35. ; ROUTINE TO PRINT A MESSAGE TO THE GRAPHICS SCREEN
  36. ;
  37. gmessout    proc    far
  38. ;
  39. ; get (x,y) location of message on screen
  40.     mov    ax,xmess    ; get x-coord on screen
  41.     mov    x0,ax        ; for first char
  42.     mov    ax,ymess    ; get y-coord on screen
  43.     mov    y0,ax        ; for first char
  44.     cld            ; forward direction
  45. ;
  46. ; main loop through characters of the message
  47. gmessloop:
  48.     cld            ; forward direction
  49.     lodsb            ; get the ASCII code
  50.     cmp    al,0        ; test for end of string
  51.     je    gmessexit
  52. ;
  53. ; check for fonts
  54. font0:
  55.     cmp    font,0        ; use font 0 ?
  56.     jne    nextchar
  57.     call    rchar        ; plot raster characters
  58. ;
  59. nextchar:
  60.     mov    al,8        ; char cell width
  61.     mov    cl,xmagn    ; times horizontal magnitude
  62.     mul    cl        ; multiply
  63.     add    x0,ax        ; add to location of previous char
  64. ;
  65.     jmp    gmessloop    ; loop for next char
  66. ;
  67. gmessexit:
  68.     ret            ; return
  69. ;
  70. gmessout    endp
  71. ;-------------------------gmessout routine ends---------------------------+
  72.